Skip to content

test(route-parity): declared===enforced gate + honest standalone hono discovery (#3369)#3386

Merged
os-zhuang merged 1 commit into
mainfrom
claude/route-parity-discovery-advertised-p2zv5e
Jul 21, 2026
Merged

test(route-parity): declared===enforced gate + honest standalone hono discovery (#3369)#3386
os-zhuang merged 1 commit into
mainfrom
claude/route-parity-discovery-advertised-p2zv5e

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

The route-parity declared === enforced gate for HTTP routes #3369 asks for — the "one boot-the-real-server test" that closes the class of "works in the dispatcher, dead on os serve" bugs (#3361, #3362, MCP 501).

Rebased & slimmed. While this was in flight, the two underlying fixes landed independently on main:

So this PR now carries only the net-new, non-overlapping work: the discovery route-parity gate.

Changes

1. Route-parity e2e gate (packages/runtime/src/route-parity.integration.test.ts).
Boots the real hono app the way os serve mounts it (hono server + dispatcher plugin, services provisioned), opens a socket, reads /api/v1/discovery, and asserts:

  • every advertised / dispatcher-registered route is reachable — never 404/405/501 — for an anonymous AND an admin principal (covers /notifications, /notifications/read[/all], /mcp, /health, /ready);
  • discovery is service-aware in both directions — a route is advertised iff its backing service is present (no dead advertisement);
  • the MCP discovery↔route lockstep holds (advertised ⇒ reachable, never 501).

It deliberately does not duplicate the Server-Timing coverage (#3384's server-timing-e2e.test.ts / rest-server-timing.test.ts), the notifications mark-read coverage (#3388), or the REST-owned /data·/meta·/ui coverage (@objectstack/client integration suite).

2. Documented the MCP discovery lockstep (http-dispatcher.ts, comment-only): why routes.mcp is advertised on the isMcpServerEnabled() flag (the #2698 auto-load lockstep) rather than gated on service presence — keeps the dispatcher symmetric with @objectstack/rest.

Test + comment only; no runtime code changes (no-release changeset).

Verification

  • @objectstack/runtime: route-parity gate green; @objectstack/plugin-hono-server + @objectstack/client suites green locally.
  • eslint / tsc --noEmit clean.

Note

An earlier revision also trimmed the standalone HonoServerPlugin discovery to advertise only its mounted routes (/data + /auth/me/*). That was dropped: it's a shadowed fallback path (never served under real os serve), and it changed a discovery contract the @objectstack/client suite depends on (client.hono.test.ts expects metadata advertised). Not worth altering a cross-package contract for a shadowed path; can be revisited deliberately if desired.

Refs: #3369, #3361 (fixed in #3384), #3362 (#3354 / #3388), #2698, #3358.

🤖 Generated with Claude Code

https://claude.ai/code/session_015si15Q1KWMKpVQWYsEvgcS

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 21, 2026 3:03pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/l labels Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/runtime.

17 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/api/index.mdx (via @objectstack/runtime)
  • content/docs/api/wire-format.mdx (via @objectstack/runtime)
  • content/docs/automation/hook-bodies.mdx (via @objectstack/runtime)
  • content/docs/concepts/north-star.mdx (via packages/runtime)
  • content/docs/data-modeling/drivers.mdx (via @objectstack/runtime)
  • content/docs/deployment/index.mdx (via @objectstack/runtime)
  • content/docs/deployment/production-readiness.mdx (via @objectstack/runtime)
  • content/docs/deployment/single-project-mode.mdx (via @objectstack/runtime)
  • content/docs/deployment/vercel.mdx (via @objectstack/runtime)
  • content/docs/getting-started/your-first-project.mdx (via @objectstack/runtime)
  • content/docs/permissions/authentication.mdx (via @objectstack/runtime)
  • content/docs/permissions/authorization.mdx (via packages/runtime)
  • content/docs/plugins/packages.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/http-protocol.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/index.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/lifecycle.mdx (via @objectstack/runtime)
  • content/docs/releases/implementation-status.mdx (via @objectstack/runtime)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang force-pushed the claude/route-parity-discovery-advertised-p2zv5e branch from c2819f4 to f95356f Compare July 21, 2026 14:45
@github-actions github-actions Bot added size/m and removed size/l labels Jul 21, 2026
@os-zhuang os-zhuang changed the title fix(hono-server): admin-gated Server-Timing on os serve + route-parity gate (#3369, #3361) test(route-parity): declared===enforced gate + honest standalone hono discovery (#3369) Jul 21, 2026
…3369)

Adds the "boot-the-real-server" route-parity gate #3369 calls for, rebased onto
main after the #3361 Server-Timing fix (#3384) and the notifications mark-read
e2e (#3388) landed independently. Keeps only the net-new, non-overlapping work.

- runtime: route-parity e2e gate (`route-parity.integration.test.ts`). Boots the
  real hono app the way `os serve` mounts it (hono server + dispatcher plugin,
  services provisioned), reads `/api/v1/discovery`, and asserts every advertised
  / dispatcher-registered route is reachable (never 404/405/501) for an anonymous
  AND an admin principal, and that discovery is service-aware in both directions
  (no dead advertisement). Closes the "works in the dispatcher, dead on os serve"
  class (#3361/#3362/MCP 501) with one test. Does not duplicate the Server-Timing
  (#3384) / notifications mark-read (#3388) / REST `/data`·`/meta`·`/ui`
  (@objectstack/client) coverage.

- http-dispatcher: document why `routes.mcp` is advertised on the
  `isMcpServerEnabled()` flag (the #2698 auto-load lockstep) rather than gated on
  service presence — comment only, keeps the dispatcher symmetric with
  @objectstack/rest.

Test + comment only; no runtime code changes (no-release changeset).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015si15Q1KWMKpVQWYsEvgcS
@os-zhuang
os-zhuang force-pushed the claude/route-parity-discovery-advertised-p2zv5e branch 2 times, most recently from f95356f to a40d0bf Compare July 21, 2026 14:51
@os-zhuang
os-zhuang marked this pull request as ready for review July 21, 2026 15:13
@os-zhuang
os-zhuang merged commit 70c0e7a into main Jul 21, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/route-parity-discovery-advertised-p2zv5e branch July 21, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants